﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MoonSharp.Interpreter.Execution.VM
{
	class LoopTracker
	{
		class Flow
		{
			public RuntimeScopeFrame ScopeFrame { get; set; }
			public List<Instruction> BreakStatements { get; set; }
		}

		List<Flow> m_Flows = new List<Flow>();

		internal void Enter(RuntimeScopeFrame runtimeScopeFrame)
		{
			m_Flows.Push(new Flow()
			{
				 ScopeFrame = runtimeScopeFrame,
				 BreakStatements = new List<Instruction>()
			});
		}

		internal void Leave()
		{
			m_Flows.Pop();
		}
	}
}
